#include <QtGui/QApplication>
#include "mainwindow.h"
#include "cbusschedule.h"
#include "globalParameter.h"
#include "QDebug"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    CBusScheduler::InitInstance();

    CBusScheduler::GetInstance()->ReadBusInfoFromXML("d:\\a.xml");

//    CBusScheduler::GetInstance()->TestBusInfoMap();

    QTime time(8,5);
    vector<STATION_INFO_FOR_OUT> result;
    CBusScheduler::GetInstance()->GetSpecifiedBusInfo("66", time, result);

    CBusScheduler::GetInstance()->TestGetSpecidfiedBusInfoResult(result);

    vector<BUS_INFO_FOR_OUT> result2;
    qDebug() << "first try no common stations\n";
    // no common stations
    CBusScheduler::GetInstance()->GetBusArrivingTime("A", "F", time, result2);
    CBusScheduler::GetInstance()->TestGetBusArrivingTimeResult(result2);

    qDebug() << "second try one bus\n";
    // only one bus
    CBusScheduler::GetInstance()->GetBusArrivingTime("A", "B", time, result2);
    CBusScheduler::GetInstance()->TestGetBusArrivingTimeResult(result2);

    qDebug() << "third try multiple buses\n";
    // multiple bus
    CBusScheduler::GetInstance()->GetBusArrivingTime("B", "D", time, result2);
    CBusScheduler::GetInstance()->TestGetBusArrivingTimeResult(result2);

    return a.exec();
}
